import { Gender } from '@app/types/enums';
import { Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm';

import { Account } from './account.entity';

@Entity()
export class Profile {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ type: 'enum', enum: Gender, default: Gender.UNKNOWN })
  geneder: Gender;

  @Column({ length: 255, default: '' })
  avatar: string;

  @Column({ length: 100, default: '' })
  email: string;

  @Column({ length: 30, default: '' })
  phone: string;

  @Column({ length: 50, default: '' })
  nickname: string;

  @Column({ type: 'text', nullable: true })
  description?: string;

  @OneToOne(() => Account, (account) => account.profile)
  account: Account;
}
